package com.midou.administration.controller;


import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.midou.administration.bo.CommonResult;
import com.midou.administration.bo.OrderInfoBo;
import com.midou.administration.service.OrderInfoService;
import com.midou.administration.bo.UserBo;
import com.midou.administration.entity.Order;
import com.midou.administration.entity.OrderInfo;
import com.midou.administration.service.impl.OrderInfoServiceImpl;
import com.midou.administration.utils.Toot;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author MrChen
 * @since 2021-03-24
 */
@RestController
@RequestMapping("/administration/order-info")
public class OrderInfoController {

    @Autowired
    private OrderInfoServiceImpl orderInfo;

    @Autowired
    private OrderInfoService orderInfoService;


    @RequestMapping("/addInfo")
    public int test(@RequestBody Toot toot) {
        System.out.println("进入");
        return this.orderInfoService.addInfo(toot);
    }
    @RequestMapping("orderInfoQuery")
    public List<OrderInfo> orderInfoQuery(@RequestBody Integer id){
        return orderInfo.orderInfoQuery(id);
    }

    //查询会员手机号是否存在
    @RequestMapping("/queryphone")
    public CommonResult queryphone(@RequestBody String phone){
        return orderInfo.queryphone(phone);
    }

    //现金支付修改订单状态
    @RequestMapping("/xianjinZhiFu")
    public CommonResult xianjinZhiFu(@RequestBody UserBo userBo){
        return orderInfo.xianjinZhiFu(userBo);
    }
    //打印小票前查询
    @RequestMapping("/daYin")
    public String daYinQuery(@RequestBody OrderInfoBo orderInfoBo){
        return orderInfo.daYinQuery(orderInfoBo);
    }
    //打印给厨房端
    @RequestMapping("/chufang")
    public String chufang (@RequestBody OrderInfoBo orderInfoBo){
        return orderInfo.chufang(orderInfoBo);
    }


}
